<?
//<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
session_start();
require ("inc.php");
$db_admin    = &new db($scfg['db']['admin']);
$rows  = 10;
$page  = (int)($_REQUEST['page']?$_REQUEST['page']:1);
admin_core::check();
/* 以下是程序部份 */
$table = $admin['table']['name'];
if($_POST['Pact'] == "modify_profile")
{
	$master = admin_core::getMaster();
	if($master)
	{
		$bind = array(
			"nickname"=>$_POST["nickname"],
			"name"=>$_POST["name"],
			"branch"=>$_POST["branch"],
			"area"=>$_POST["area"],
			"tel"=>$_POST["tel"],
			"mobile"=>$_POST["mobile"],
			"email"=>$_POST["email"],
		);
		$rs = $db_admin->update($table,$bind," `master` = ? ",$master);
		if($rs)
		{
			echo g::msg("成功：更改资料成功!");
		}else
		{
			echo g::msg("提示：系统忙，请重试!");
		}		
		g::gowin("?");	
	}else
	{
		echo g::msg("失败：非法操作!");
		g::gowin("?");	
	}
}

$where = array(
	'where' => " where master = :master ",
	'bind'  => array('master' => admin_core::getMaster())
);
$rs    = $db_admin->rsArray("select * from {$table} {$where['where']}",$where['bind']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link  href="static/admincp.css" rel="stylesheet" type="text/css" id="css">
<script src="Script/lib.js" 	type="text/javascript"></script>
<script src="Script/lib.ext.js" type="text/javascript"></script>
<script src="Script/lib.ext.oAdmin.js" type="text/javascript"></script>
<script type="text/javascript">
if(typeof XypForm == "undefined")
{
	_.r('<script src="static/xypform/xypfrom.js" type="text/javascript"></sc'+'ript>');
	_.r('<link  href="static/xypform/xypform.css" rel="stylesheet" type="text/css">');
}
var collapsed = $.cookie('DTh_collapse');
function collapse_change(menucount)
{
	if(_.e('menu_' + menucount).style.display == 'none') 
	{
		_.e('menu_' + menucount).style.display = '';collapsed = collapsed.replace('[' + menucount + ']' , '');
		_.e('menuimg_' + menucount).src = 'static/img/menu_reduce.gif';
	} else 
	{
		_.e('menu_' + menucount).style.display = 'none';collapsed += '[' + menucount + ']';
		_.e('menuimg_' + menucount).src = 'static/img/menu_add.gif';
	}
	$.cookie('DTh_collapse', collapsed, 2592000);
}
</script>
</head>
<body leftmargin="10" topmargin="10">
<table width="100%" border="0" cellpadding="2" cellspacing="6">
  <tr>
    <td>
      <form method="post" name="settings" id="settings" onsubmit="return XypForm(this)">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
          <tr class="header">
            <td colspan="2">修改资料 - 更改资料</td>
          </tr>
          <tbody>
            <tr>
              <td width="40%" class="altbg1" >
                <b>添加帐号:</b><br />
                <span class="smalltxt">管理人员，登录时用的ID</span>
              </td>
              <td class="altbg2">
              	<input type="text" require="1" minlen="4"  maxlen="20"  dataType="alphanum" <?=($rs["master"]?' readonly="readonly" value="'.$rs["master"].'" ':'')?>  size="50" name="master">
              </td>
            </tr>
            <tr>
              <td width="40%" class="altbg1" >
                <b>管理人员昵称:</b><br />
                <span class="smalltxt">管理人员昵称，或英文名。如:cyberty </span>
              </td>
              <td class="altbg2">
              	<input type="text" value="<?=$rs['nickname']?>" size="50" name="nickname">
              </td>
            </tr>
            <tr>
              <td width="40%" class="altbg1" ><b>真实姓名:</b><br />
                <span class="smalltxt">真实姓名，最好填上吧！</span></td>
              <td class="altbg2"><input  type="text" require="1" minlen="4"  maxlen="10"  size="50" name="name" value="<?=$rs['name']?>" >
              </td>
            </tr>
            <tr>
              <td width="40%" class="altbg1" ><b>所在部门:</b><br />
                <span class="smalltxt">所在部门，请填清楚最好把子部门也写上。如：产品部-推广部</span></td>
              <td class="altbg2"><input type="text" require="1" size="50" name="branch" value="<?=$rs['branch']?>" >
              </td>
            </tr>
            <tr>
              <td width="40%" class="altbg1" ><b>所在地区:</b><br />
                <span class="smalltxt">所在地区，工作所在地。如：广州 北京</span></td>
              <td class="altbg2"><input type="text" require="1" size="50" name="area" value="<?=$rs['area']?>" >
              </td>
            </tr>
            <tr>
              <td width="40%" class="altbg1" ><b>联系电话:</b><br />
                <span class="smalltxt">联系电话，如果可以请填上你的可联系到你的座机，办公室分机，用逗号分开 如:1348022576X,020-8552454X,020-85533243-8025</span></td>
              <td class="altbg2"><input type="text" require="1" size="50" name="tel" value="<?=$rs['tel']?>" ></td>
            </tr>
            <tr>
              <td width="40%" class="altbg1" ><b>移动电话:</b><br />
                <span class="smalltxt">移动电话，如果可以请填上你的随时可联系到你的移动电话</span></td>
              <td class="altbg2"><input type="text" size="50" require="1"  dataType="nums" name="mobile" value="<?=$rs['mobile']?>" ></td>
            </tr>
            <tr>
              <td width="40%" class="altbg1" ><b>EMAIL:</b><br />
                <span class="smalltxt">EMAIL，公司的邮箱地址</span></td>
              <td class="altbg2"><input type="text" size="50" dataType="email" require="1" name="email" value="<?=$rs['email']?>" ></td>
            </tr>            
          </tbody>
        </table>
        <br />
        <center>
          <input type="hidden"  name="Pact"   value="modify_profile">
          <input class="button" type="submit" value="提 交">
        </center>
      </form></td>
  </tr>
</table>
<br />
<br />
<? include("s_tpl.copyright.php"); ?>
</body>
</html>